Function reference previous pagenext page

2.2: uix.VBox Go back up one level


Arrange elements vertically in a single column

obj = uix.VBox( )
creates a new vertical box layout with all properties set to defaults. The output is a new layout object that can be used as the parent for other user-interface components.
obj = uix.VBox( prop, value, ... )
also sets one or more property values.

uix.VBox properties

PropertyValueDescription
BackgroundColor colorspecColor to use for exposed areas of the layout background. This can be an RGB triple (e.g. [0 0 1]) or a colour name (e.g. 'b').
BeingDeleted on | offDeletion status.
Contents empty GraphicsPlaceholder array | array of graphics objectsChildren within this layout, regardless of HandleVisibility. Note that this can only be set to permutations of itself.
DeleteFcn function_handleFunction to call when the layout is being deleted.
Heights double vectorHeight of each of the children. Positive entries indicate fixed sizes in pixels, negative values indicate relative weights for resizing. The size of this vector must always match the size of Contents.
MinimumHeights double vectorMinimum height in pixels of each of the children. The size of this vector must match the size of Contents.
Padding positive integerNumber of pixels of extra space around the outside of the layout.
Parent empty GraphicsPlaceholder array | figure | containerParent of the layout.
Position [x y w h]Position (x,y) and size (w,h) within figure or container.
Spacing positive integerNumber of pixels of extra space to leave between elements in the layout.
Tag stringTag to associate with layout.
Type stringType of graphics object.
Units inches | centimeters | normalized | points | pixels | charactersPosition units.
Visible on | offVisibility.

For example:

f = figure();
b = uix.VBox( 'Parent', f );
uicontrol( 'Parent', b, 'Background', 'r' )
uicontrol( 'Parent', b, 'Background', 'b' )
uicontrol( 'Parent', b, 'Background', 'g' )
set( b, 'Heights', [-1 100 -2], 'Spacing', 5 );

f = figure();
b1 = uix.VBox( 'Parent', f );
uicontrol( 'Parent', b1, 'Background', 'r' )
b2 = uix.HBox( 'Parent', b1, 'Padding', 5, 'Spacing', 5 );
uicontrol( 'Parent', b2, 'String', 'Button1' )
uicontrol( 'Parent', b2, 'String', 'Button2' )
set( b1, 'Heights', [30 -1] );


See also:
© 2016 The MathWorks Ltd Terms of Use Patents Trademarks